<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Clients extends CI_Controller {

    public function index()
    {
        
    }
    public function add()
    {  
        $this->load->model('Clients_model');
                
             $data= array();
               
	        $data['name'] = $this->input->post('name');
	        $data['document_client'] = $this->input->post('ruc');
	        $data['direccion'] = $this->input->post('address');	       
	        $data['telefono'] = $this->input->post('telephone');
	        $data['email'] = $this->input->post('email');
                $data['celular'] = $this->input->post('cel');
                $data['referencia'] = $this->input->post('referencia');
                $data['id_type_client'] = $this->input->post('tclient');
                $data['id_contacto'] = $this->input->post('contacto');
                
	        $data['status'] = 1;
	        $data['create'] = date('Y-m-d H:i:s');
                $this->Clients_model->add($data); 
                
        redirect('/contrato/add');
        
	}
}